package com.mzy.javaapi.arrayApi;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/6/20 9:35
 * @Version 1.0
 */
public class ArrayToString {
    /**
     * 因为java中的数组没有实现toString方法，
     * 所以数组打印会比较麻烦。可以借用以下API
     */

    public static void main(String[] args) {
        String a = "a,b,b,v";
        String[] split = a.split(",");
        // arrays.toString
        System.out.println(Arrays.toString(split));
        // arrays.deepToString 深沉打印
        String[] arr1 = new String[]{"Fifth", "Sixth"};
        String[] arr2 = new String[]{"Seventh", "Eight"};
        // 数组的数组
        String[][] arrayOfArray = new String[][]{arr1, arr2};
        System.out.println(Arrays.deepToString(arrayOfArray));
    }
}
